//
//  MQFMDBManager.m
//  MQ
//
//  Created by 曾杰 on 15/10/29.
//  Copyright © 2015年 徐永祥. All rights reserved.
//

#import "MQFMDBManager.h"
@implementation MQFMDBManager


+ (FMDatabase *)shareDataBase
{
    static FMDatabase *db = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        NSString *filePath = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES).firstObject;
        NSString *newFilePath = [filePath stringByAppendingString:@"dataBase.db"];
        db = [FMDatabase databaseWithPath:newFilePath];
    });
    return db;
    
}
//打开数据库
+ (void)openDataBase:(FMDatabase *)db update:(NSString *)update
{
    if ([db open]) {
        [db executeUpdate:update];
    }else{
        NSLog(@"打开失败");
    }

}







@end
